import {Box, Text, Toast} from 'native-base';

const baseToast = {
  // placement: 'top',
  duration: 500,
  avoidKeyboard: true,
};
export const showErrorToast = (msg: string) => {
  Toast.show({
    ...baseToast,
    render: () => (
      <Box bg={'danger.500'} p={'3'} rounded={'xl'}>
        <Text color={'white'}>{msg}</Text>
      </Box>
    ),
  });
  // toast.close(id);
};

export const showSuccessToast = (msg: string) => {
  Toast.show({
    ...baseToast,
    render: () => (
      <Box bg={'success.500'} p={'3'} rounded={'xl'}>
        <Text color={'white'}>{msg}</Text>
      </Box>
    ),
  });
  // toast.close(id);
};

export const showWaringToast = (msg: string) => {
  Toast.show({
    ...baseToast,

    render: () => (
      <Box bg={'warning.500'} p={'3'} rounded={'xl'}>
        <Text color={'white'}>{msg}</Text>
      </Box>
    ),
  });
  // toast.close(id);
};

export const showInfoToast = (msg: string) => {
  Toast.show({
    ...baseToast,

    render: () => (
      <Box bg={'info.500'} p={'3'} rounded={'xl'}>
        <Text color={'white'}>{msg}</Text>
      </Box>
    ),
  });
  // toast.close(id);
};
